import java.util.*;

public class Mapwork2 {
    public static void main(String[] args) {
        List list = Arrays.asList("a", "b", "a", "b", "c", "a", "b", "c", "b");
        System.out.println(list);
        int a = 0;
        int b = 0;
        int c = 0;
        for(Object obj : list){
            if (obj.equals("a")){
                a++;
            }if (obj.equals("b")){
                b++;
            }if (obj.equals("c")){
                c++;
            }
        }
        Map<Integer,String> map = new HashMap<>();
        map.put(a,"a");
        map.put(b,"b");
        map.put(c,"c");
        Set set = map.keySet();
        for (Object obj : set){
            System.out.println(obj + "" +map.get(obj));
        }
    }
}
